<?php /*
$model = Reviews::model()->findAll(array('select' => '*, rand() as rand', 'limit' => '4', 'order' => 'rand'));
?> 

<?php
if (!empty($model)) {
    foreach ($model as $reviewsVal) {
        ?>
        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 quote column3">
            <p><?php echo substr($reviewsVal->reviews_text,0,100).'...'; ?>
                <span><?php
                    echo (isset($reviewsVal->users->profiles[0]->first_name)) ? $reviewsVal->users->profiles[0]->first_name . ' ' . $reviewsVal->users->profiles[0]->last_name : SkillConfig::SKILL_NO_USERNAME;
                    ?></span>
            </p>
        </div>

    <?php }
}
*/?>
<?php
$model = TrainerProfileReview::model()->findAll(array('select' => '*, rand() as rand', 'limit' => '4', 'order' => 'rand'));
?> 

<?php
if (!empty($model)) {
    foreach ($model as $reviewsVal) {
          $profile = Users::getFrontEndUser($reviewsVal->from_user_id);
        ?>
        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 quote column3">
            <p><?php echo html_entity_decode(substr($reviewsVal->reviews_text,0,95)).'...'; ?>
                <span><?php
                    echo  !empty($profile)?$profile['first_name'] . '   ' . $profile['last_name'] : SkillConfig::SKILL_NO_USERNAME;
                    ?></span>
            </p>
        </div>

    <?php }
}
?>
